"""

"""
from typing import List


class Solution:
    def findMin(self, nums: List[int]) -> int:
        left, right = -1, len(nums) - 1 
        while left + 1 < right:  
            mid = (left + right) // 2
            if nums[mid] == nums[right]:
                right -= 1
            elif nums[mid] < nums[right]:
                right = mid
            else:
                left = mid
        return nums[right]


if __name__=='__main__':
    s=Solution()
    nums=[2,2,2,0,1]
    res=s.findMin(nums)
    print(res)